package com.hm.PushCaseService.utils.json;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONException;

public class JsonUtils {
    //判断是否为json格式
    public static boolean isJson(String data) {
        if (data == null || data.isEmpty()) {
            return false;
        }
        try {
            JSON.parse(data);
        } catch (JSONException e) {
            return false;
        }
        return true;
    }
}
